<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;padding: 0;
        }
        .bigbox{
            width: 100%;
            height: 380px;
            background-color:#f5f5f5;
            position: fixed;
            bottom: 0px;
            margin-bottom: 30px;
        }
        .bigbox .good{
            display: flex;
            justify-content: space-between;
        }
        .bigbox .good div{
            font-weight: bold;
            margin: 10px ;
        }
        .shpi .xiangq .jia{
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .bigbox>.shpi>.xiangq>.jia>.qun>span:nth-child(1){
            width: 20px;
            background-color: rgb(104, 189, 238);
            display:inline-block;
            height: 20px;
            text-align: center;
            border-radius: 50%;
            line-height: 20px;
        }
        .bigbox>.shpi>.xiangq>.jia>.qun>span:nth-child(3){
            width: 20px;
            background-color: rgb(104, 189, 238);
            display:inline-block;
            height: 20px;
            text-align: center;
            border-radius: 50%;
            line-height: 20px;
        }
        .bigbox>.shpi{
            display: flex;
        }
        .bigbox>.shpi>.imgbox>img{
            width: 100px;
            height: 100px;
        }
        .bigbox>.shpi>.xiangq>.jia{
            margin-top: 50px;          
        }
        .bigbox>.shpi>.xiangq>.jia>.jiage{
            margin-right: 160px;
        }
        .bigbox.dibu{
            width: 100%;
            height: 50px;
            background-color: rgb(221, 108, 108);
        }
        .bigbox .empty{
            width: 100%;
            height: 100px;
            text-align: center;
            line-height: 180px;
        }
        .jisuan{
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: #555;
            color: white;
            left: 0;
            position: fixed;
            bottom: 0;
            width: 100%;
            padding: 10px;
            box-sizing: border-box;
        }
        .jisuan span:nth-child(2){
            background-color: lightgreen;
            color: white;
            padding: 5px 15px;
            border-radius: 5px;
        }

    </style>
</head>
<body>

    <div id="app">
        <div class="bigbox">
            <div class="good">
                <div>已选商品</div><div @click="clean">清空</div>
            </div>
            <div v-for="(item,index) in list " :key="index" class="shpi">
                <div class="imgbox">
                    <img :src="item.pic" alt="">
                </div>
                <div class="xiangq">
                    <div class="name"> {{item.name}} </div>
                    <div class="jia">
                        <div class="jiage">￥ {{item.jiage}} </div>
                        <div class="qun">
                            <span @click="sub(item)">-</span>
                            <span> {{item.count}} </span>
                            <span @click="add(item)">+</span>
                        </div>

                    </div>
                </div>
            </div>
            <div class="empty" v-show="list.length == 0">购物车空空如也,去逛逛!</div>

            <div class="jisuan">
                <span>总数：{{totalCount}} 总价：{{totalPrice}}</span>
                <span>去结算</span>
            </div>
        
        </div>



    </div>
    

    <script src="./vue-2.5.21.js"></script>
    <script src="./2.购物车.js"></script>
</body>
</html>